package com.yn.service.zy.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yn.common.model.zy.TDoctorInfoDO;
import com.yn.common.utils.BeanUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.ObjectUtils;

import java.sql.Date;
import java.util.List;

/**
 * @ClassName: TDoctorInfoOutDTO
 * @Description:
 * @Author: lxp
 * @Date: 2025/5/6 16:55
 **/
@Data
@ApiModel("就医绿通出参")
public class TDoctorInfoOutDTO {
    @ApiModelProperty("主键id")
    private Integer doctorId;

    @ApiModelProperty("医生名称")
    private String doctorName;

    @ApiModelProperty("医生头像地址")
    private String headImageUrl;

    @ApiModelProperty("职称")
    private String doctorLever;

    @ApiModelProperty("机构id")
    private Integer organInfoId;

    @ApiModelProperty("医院名称")
    private String hospitalName;


    @ApiModelProperty("科室名称")//多个有逗号分隔
    private String departmentNames;

   /* @ApiModelProperty("科室名称集合")
    private List<OrganDepartmentDTO> departments;*/

    @ApiModelProperty("学历")
    private String education;

    @ApiModelProperty("专业擅长")
    private String professionalField;

    @ApiModelProperty("个人介绍")
    private String doctorIntro;

    @ApiModelProperty("电话")
    private String phoneNumber;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    public static TDoctorInfoOutDTO transform(TDoctorInfoDO tDoctorInfoDO){
        if (ObjectUtils.isEmpty(tDoctorInfoDO)) {
            return null;
        }

        TDoctorInfoOutDTO tDoctorInfoOutDTO = BeanUtils.copyProperties(tDoctorInfoDO, TDoctorInfoOutDTO.class);
        tDoctorInfoOutDTO.setDoctorId(tDoctorInfoDO.getId());
        tDoctorInfoOutDTO.setHospitalName(tDoctorInfoDO.getBelongingHospital());

        return tDoctorInfoOutDTO;
    }
}
